package test.common.crypto;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

	/**
	 * <p>Class       : test.encoder.EncoderThread
	 * <p>Descdription: 验证Encoder对CPU的耗费情况
	 * @author  顾力行-gulixing@msn.com
	 * @version 1.0.0
	 */
	public class EncoderThread extends Thread {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = LoggerFactory.getLogger(EncoderThread.class);
	
//	    BCryptPasswordEncoder bpe = new BCryptPasswordEncoder();
	    
	    @Override
	    public void run() {
	        BCryptPasswordEncoder bpe = new BCryptPasswordEncoder();

	    	while(true){
	    		bpe.encode("hahahaha");	
	    		try {
                    Thread.sleep(10);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
//	    		logger.info(this.getId()+" | "+bpe.encode(RandomStringUtils.randomAlphabetic(6)));
	    	}
	    }
	
	
}

